package com.hnucm.springjdbc.service.impl;

import com.hnucm.springjdbc.dao.BookDao;
import com.hnucm.springjdbc.pojo.Books;
import com.hnucm.springjdbc.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class BookServiceImpl implements BookService {
    @Autowired
    BookDao bookDao;
    public void addBooks(String name,double price, int amount) {
        bookDao.addBooks(name,price,amount);
    }

    public List<Books> findAllBooks() {
        return bookDao.findAllBooks();
    }

    public void deleteBooks(int id) {
        bookDao.deleteBooks(id);
    }

    public void updataBooks(int id, String name,double price, int amount) {
        bookDao.updataBooks(id,name,price,amount);
    }
}
